package com.shd.edanpei.ui.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.bumptech.glide.Glide;
import com.shd.edanpei.R;
import com.shd.edanpei.base.BaseIPresenter;
import com.shd.edanpei.base.TranBarActivity;

import butterknife.BindView;
import uk.co.senab.photoview.PhotoView;
import uk.co.senab.photoview.PhotoViewAttacher;

/**
 * Created by mc on 2018/12/5.
 * 大图查看
 */

public class PictureActivity extends TranBarActivity {

    @BindView(R.id.photoView)
    PhotoView photoView;


    private String mImageUrl;

    @Override
    protected int setLayout() {
        return R.layout.activity_picture;
    }

    @Override
    protected BaseIPresenter bindPresenter() {
        return null;
    }

    @Override
    protected void initView(@Nullable Bundle savedInstanceState) {

        Bundle bundle = getIntent().getExtras();
        mImageUrl = bundle.getString("image_url");
        Glide.with(this).load(mImageUrl).into(photoView);

    }

    @Override
    protected void initListener() {
        photoView.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
            @Override
            public void onPhotoTap(View view, float v, float v1) {
                onBackPressed();
            }
        });
    }


}
